#!/usr/bin/env python

import roslib; roslib.load_manifest('DelphinROSv2')
import rospy
import smach
import smach_ros

# Stop class
# @param: smach.State - doesn't need to be passed by calling method - only used internally
#
# __init__ - initialises a Stop object
# execute - calls the stop() method in library_highlevel.py, ending the current mission and ROS session.

class Stop(smach.State):
	def __init__(self, lib):
		smach.State.__init__(self, outcomes=['succeeded'])
                self.__controller = lib
                   		
	def execute(self,userdata):
		#SYTEMS STOP
                self.__controller.stop()
                return 'succeeded'